var app = angular.module('app');

app.directive('imageGallery', [function () {
    return {
        templateUrl: 'tpl/imageGallery/imageGallery.html',
        restrict: 'EA',
        replace: false,
        scope: {
            selectUrl: '=',
            images: '='
        },
        link: function (scope, element, attrs) {
            scope.isOpened = false;
            scope.selectImage = function (index) {
                scope.selectUrl = scope.images[index].thumbUrl;
            }
        }
    };
}]);